#!/usr/bin/node

const http = require('http'),
      log  = console.log;

http.createServer((req,res)=>{
  log(`${req.method} ${req.url} ${req.httpVersion}`);//请求起始行

  log(req.headers);

  req.pipe(process.stdout);//请求体中的数据，是可读流，需要用流的操作读取

  res.end('OK');
}).listen(8080);
